package com.demo.crm.springboot3security.dto;

import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;

/**
 * 表单数据响应DTO
 */
@Data
@Accessors(chain = true)
public class FormDataResponse {
    private Boolean success;           // 操作是否成功
    private String message;           // 响应消息
    private Long recordId;            // 记录ID
    private Map<String, Object> data; // 单条数据
    private List<Map<String, Object>> list; // 数据列表
    private Long total;              // 总记录数
    private Integer page;            // 当前页码
    private Integer size;            // 每页大小

    public static FormDataResponse success() {
        return new FormDataResponse().setSuccess(true).setMessage("操作成功");
    }

    public static FormDataResponse success(String message) {
        return new FormDataResponse().setSuccess(true).setMessage(message);
    }

    public static FormDataResponse error(String message) {
        return new FormDataResponse().setSuccess(false).setMessage(message);
    }
} 